<script lang="ts" setup>
import { reactive } from "vue";
import { useRouter } from "vue-router";
import { JxtechBackButton } from "@whjxtech/jxtech-component";

interface IBackButtonProps {
  /**是否自定义 */
  custom?: boolean;
}

const props = withDefaults(defineProps<IBackButtonProps>(), {
  custom: false
});

const router = useRouter();
const BackButtonState = reactive({
  onBackButtonClick() {
    if (props.custom === false) router.back();
  }
});
</script>
<template>
  <jxtech-back-button @click="BackButtonState.onBackButtonClick"></jxtech-back-button>
</template>
